package utils

import "fmt"

// CalcPercentage 计算百分比并格式化为字符串
func CalcPercentage(part, total int) string {
	if total == 0 {
		return "0.0%"
	}
	percentage := float64(part) * 100.0 / float64(total)
	return fmt.Sprintf("%.1f%%", percentage)
}
